home *** CD-ROM | disk | FTP | other *** search
/ Greatest Childrens Stories Ever Told / Greatest_Stories.iso / demos / funtown / demo.dir / 00047_Script_Scripts 2 < prev    next >
Text File  |  1994-11-08  |  10KB  |  328 lines

  1. --òòò Scripts 2
  2. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  3. on checkClickLoc clickH, clickV, clickSprite
  4.   global mode, MS, H, V, CIU, MIU, NM, M, CU
  5.   global CV
  6.   if CU then exit
  7.   if not ( CIU ) then pointerCursor 
  8.   if (clickV<the top of sprite ( 35 )) then
  9.     if CIU then restoreChalk 
  10.     if MIU then disengageMap
  11.     exit
  12.   end if
  13.   if MIU then
  14.     if not ( rollOver ( 47 )) or M=the movie then disengageMap 
  15.     else go movie ( M )
  16.   end if
  17.   dontPassEvent
  18.   if (clickH>385) then
  19.     restoreChalk
  20.   end if
  21. end
  22. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  23. on doArrow whichArrow
  24.   global CV, WT, CU, MIU
  25.   if CU then exit
  26.   if CV="0" then 
  27.     beep
  28.     exit
  29.   end if
  30.   if CV="c" then set whereToGeneral = item 9 of WT
  31.   else set whereToGeneral = item value(CV) of WT
  32.   set whereToSpecific = char whichArrow of whereToGeneral
  33.   if whereToSpecific="0" then
  34.     if MIU then activate 48,the number of cast ("Red Arrow "& whichArrow),1,36,433,316,"","",""
  35.     else activate 47,the number of cast ("Red Arrow "& whichArrow),1,36,433,316,"","",""
  36.     updateStage
  37.     beep
  38.   else
  39.     if MIU then activate 48,the number of cast ("Green Arrow "& whichArrow),1,36,433,316,"","",""
  40.     else activate 47,the number of cast ("Green Arrow "& whichArrow),1,36,433,316,"","",""
  41.     updateStage
  42.     set CV=whereToSpecific
  43.     reposition (CV)
  44.   end if
  45.   startTimer
  46.   repeat while the timer<3 or the mouseDown
  47.     do ( "nothing" )
  48.   end repeat
  49.   deactivate string ( 47 ) -- no need to store/restore, as channels 46-48 should be left empty in the score.
  50.   updateStage
  51. end
  52. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  53. on doBell
  54.   global CV, H, V, CIU, MIU, EB, CU, MIU
  55.   if CU then exit
  56.   set CU = true
  57.   if MIU then set floatingSprite = 48
  58.   else set floatingSprite = 47
  59.   store string ( floatingSprite )
  60.   activate floatingSprite,the number of cast "exit bell 1",1,0,486,296,"","",""
  61.   Sound PlayFile 1,  "School.Bel"
  62.   updateStage
  63.   repeat while the soundBusy of 1
  64.     set the castNum of sprite floatingSprite=the number of cast "exit bell 2"
  65.     updateStage
  66.     set the castNum of sprite floatingSprite=the number of cast "exit bell 1"
  67.     updateStage
  68.   end repeat
  69.   deactivate string ( floatingSprite ) 
  70.   updateStage
  71.   set EB = 1
  72.   doWindow
  73. end
  74. --¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
  75. on doHelp
  76.   global  CU
  77.   if CU then exit
  78.   store string ( 47 )
  79.   activate 47,the number of cast "!",1,0,497,316,"","",""
  80.   Sound playFile 1,   "Help"
  81.   updateStage
  82.   restore string ( 47 )
  83.   updateStage
  84.   if the frame >= label ( "map" ) and the frame <= (label ( "map" ) + 6) then disengageMap
  85.   --alert "The help feature has been disabled"&Return&"for this demo." 
  86.   doWindow2
  87. end
  88. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  89. on doHelp2
  90.   global JOS
  91.   if voidP ( JOS ) then set JOS=random ( 2 ) -1 
  92.   else set JOS=not ( JOS )
  93.   if JOS=0 then set whichHelpScreen="Jimmy Help"
  94.   else set whichHelpScreen="Sally Help"
  95.   play movie "Around the Town:Help Screens:"& whichHelpScreen 
  96. end
  97. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  98. on doHome
  99.   global CV, H, V, CIU, MIU, mode, TMD, TF, AM, CU
  100.   if CU then exit
  101.   activate 42,the number of cast "home",1,0,496,350,"","",""
  102.   updateStage
  103.   if MIU then disengageMap 
  104.   else initializeMap
  105.   activate 42,"TransparentQDBox",1,37,480,332,"stretch to:",508,367
  106.   updateStage
  107. end
  108. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  109. on doApple
  110.   global CIU, CU
  111.   if CU then exit  
  112.   if CIU=0 then doChalk
  113.   else if CIU=1 then ChalkPalette
  114. end
  115. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  116. on doChalk
  117.   global WC, MS, CU
  118.   if CU then exit
  119.   puppetSprite ( 38 ), true
  120.   if the type of sprite ( 38 )>0 then
  121.     if the name of cast ( the castNum of sprite ( 38 ))="Chalk" then
  122.       activate 38,the number of cast ("Chalk dust "&WC),1,8,-10,-10,"","",""
  123.       updateStage
  124.       set the trails of sprite ( 38 )=true
  125.     end if
  126.   end if
  127.   chalkCursor
  128.   repeat while the stillDown
  129.     set userH=the mouseH
  130.     set userV=the mouseV
  131.     if (userH>12) then
  132.       if (userH<369) then
  133.         if (userV>273) then
  134.           if (userV<354) then
  135.             if not ((userH>316) and (userV>348)) then
  136.               if not ((userH<30) and (userV>339)) then
  137.                 if the optionDown then set the blend of sprite ( 38 )=100
  138.                 else if the locV of sprite ( 38 ) >0 then
  139.                   set chalkH=the locH of sprite ( 38 )
  140.                   set chalkV=the locV of sprite ( 38 )
  141.                   set chalkDrag=random ( 5 ) +5
  142.                   set chalkBlend=40/chalkDrag
  143.                   repeat with x=1 to chalkDrag
  144.                     set the blend of sprite ( 38 )=( chalkDrag+1-x )*chalkBlend
  145.                     set the locH of sprite ( 38 )=(userH-(userH-chalkH)/x)
  146.                     set the locV of sprite ( 38 )=(userV-(userV-chalkV)/x)
  147.                     updateStage
  148.                   end repeat
  149.                 end if
  150.                 set the locH of sprite ( 38 )=userH
  151.                 set the locV of sprite ( 38 )=userV
  152.                 updateStage
  153.               end if
  154.             end if
  155.           end if
  156.         end if
  157.       end if
  158.     end if
  159.   end repeat
  160.   set the locV of sprite ( 38 )=-5000
  161.   updateStage
  162. end
  163. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  164. on doEraser
  165.   global CIU, MS, CU
  166.   if CU then exit
  167.   puppetSprite ( 45 ), true
  168.   deactivate string ( 47 )  
  169.   -- restoreChalk 
  170.   handCursor
  171.   repeat while the stillDown
  172.     if (the mouseH>32) then
  173.       if (the mouseH<348) then
  174.         if (the mouseV>279) then
  175.           if (the mouseV<353) then
  176.             set the locH of sprite ( 45 )=the mouseH
  177.             set the locV of sprite ( 45 )=the mouseV
  178.             updateStage
  179.           end if
  180.         end if
  181.       end if
  182.     end if
  183.   end repeat
  184.   restoreCursor
  185.   set eraserH=the locH of sprite ( 45 )
  186.   set eraserV=the locV of sprite ( 45 )
  187.   repeat with x=1 to 5 
  188.     set the locH of sprite ( 45 )=(342-(342-eraserH)/x)
  189.     set the locV of sprite ( 45 )=(362-(362-eraserV)/x)
  190.     updateStage
  191.   end repeat
  192.   set the locH of sprite ( 45 )=(342)
  193.   set the locV of sprite ( 45 )=(362)
  194.   updateStage
  195.   if CIU then chalkCursor
  196.   else restoreChalk
  197.   restore string ( 47 )
  198. end
  199. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  200. on restoreChalk dontPass
  201.   if ( the commandDown ) then exit
  202.   global  CIU, MS
  203.   if CIU then
  204.     if MS="PictureDictionary" then activate 38,the number of cast "Chalk",1,8,21,339,"","","" 
  205.     else activate 38,the number of cast "Chalk",1,8,10,370,"","",""
  206.     set the trails of sprite ( 38 )=false
  207.     puppetSprite 38, false
  208.     go the frame
  209.   end if
  210.   restoreCursor
  211.   updateStage
  212.   if dontPass>0 then dontPassEvent
  213. end
  214. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  215. on changeChalkColor
  216.   global WC, CIU
  217.   if not ( CIU ) then exit
  218.   if WC>=9000 and WC<9006 then set WC=WC+1
  219.   else set WC=9000
  220.   set the castNum of sprite ( 38 )=the number of cast ("Chalk dust "&WC)
  221.   updateStage
  222.   chalkCursor
  223. end
  224. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  225. on chalkCursor 
  226.   global colorcrsr, WC, CIU
  227.   --if not objectP(colorcrsr) then set colorcrsr = colorcursor(mNew)
  228.   -- colorcrsr(mGetSetCursor, (WC))
  229.   set WC to [61]
  230.   cursor[61,62]
  231.   set CIU=1
  232. end
  233. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  234. on handCursor
  235.   global colorcrsr, WC, HIU
  236.   --set whichHand=9006+random(2)+(random(20)=20)
  237.   --if not objectP(colorcrsr) then set colorcrsr = colorcursor(mNew)
  238.   --colorcrsr(mGetSetCursor, (whichHand)) 
  239.   set whichHand to [63]
  240.   cursor[63,64]
  241.   set HIU=1
  242. end
  243. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  244. on pointerCursor 
  245.   global colorcrsr, WC, PIU
  246.   --set whichHand=9009+random(2)
  247.   --if not objectP(colorcrsr) then set colorcrsr = colorcursor(mNew)
  248.   --colorcrsr(mGetSetCursor, (whichHand)) 
  249.   --set whichHand to [63]
  250.   --cursor[63,64]
  251.   cursor -1
  252.   set PIU=1
  253. end
  254. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  255. on restoreCursor 
  256.   global colorcrsr, CIU
  257.   set CIU=0
  258.   if not objectP(colorcrsr) then exit
  259.   pointerCursor
  260. end
  261. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  262. on restoreCursor2 
  263.   global colorcrsr, CIU
  264.   set CIU=0
  265.   if not objectP(colorcrsr) then exit
  266.   colorcrsr(mReleaseCursor)
  267.   colorcrsr(mDispose)
  268.   cursor 0
  269.   cursor 4
  270.   cursor -1
  271. end
  272. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  273. on doSound whichSound 
  274.   Sound PlayFile 1,  whichSound
  275.   updateStage
  276.   repeat while the soundBusy of 1
  277.     updateStage
  278.   end repeat
  279.   updateStage
  280. end
  281. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  282. on chalkPalette
  283.   global CCC, WC
  284.   activate 47,"PaintColors1",1,0,27,355,"","",""
  285.   activate 48,"PaintSelector",1,36,31,359,"","",""
  286.   updateStage
  287.   set leftSide=the left of sprite 47
  288.   set topSide=the top of sprite 47
  289.   repeat while the stillDown
  290.     set selectorH=( the mouseH-leftSide ) / 6
  291.     set selectorV=( the mouseV-topSide ) / 6
  292.     if selectorH<0 then set selectorH=0
  293.     if selectorH>63 then set selectorH=63
  294.     if selectorV<0 then set selectorV=0
  295.     if selectorV> 3 then set selectorV=3
  296.     set the locH of sprite 48=leftSide+selectorH*6+4
  297.     set the locV of sprite 48=topSide+selectorV*6+4
  298.     updateStage   
  299.   end repeat
  300.   set whichChalkColor=selectorH +( selectorV*64 )
  301.   activate 38,the number of cast ("chalk dust userDefined"),1,8,-10,-10,"","",""
  302.   set the foreColor of sprite ( 38 )=whichChalkColor
  303.   updateStage
  304.   set the trails of sprite ( 38 )=true
  305.   set WC=9000
  306.   chalkCursor
  307.   delayFor 10
  308.   repeat with x=1 to 2
  309.     set the ink of sprite 48=37
  310.     updateStage
  311.     delayFor 10
  312.     set the ink of sprite 48=36
  313.     updateStage
  314.     delayFor 10
  315.   end repeat
  316.   deactivate string ( 47 )
  317.   deactivate string ( 48 )
  318.   CorrectInterFace
  319.   updateStage
  320. end
  321. --ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
  322. on delayFor howLong
  323.   startTimer
  324.   repeat while the timer<howLong
  325.     do ( "nothing" )
  326.   end repeat
  327. end
  328.